'use strict';

module.exports = app => {
  const {TEXT, STRING, INTEGER, DATE } = app.Sequelize;

  const Report = app.model.define('report', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    user_id: {
      type: INTEGER(64),
      allowNull: false,
      comment: '用户id',
    },
    category:{
      type: STRING(255),
      allowNull: true,
      comment: '举报类型',
    },
    content:{
      type: TEXT,
      allowNull: true,
      comment: '举报描述',
    },
    goods_id: {
      type: INTEGER(64),
      allowNull: true,
      comment: '商品id',
    },
    reported_person_id: {
      type: TEXT,
      allowNull: true,
      comment: '被举报人id',
    },
    imgs: {
      type: TEXT,
      allowNull: true,
      comment: '举报图片',
    },
    created_at: DATE,
    updated_at: DATE,
  }, {
    sequelize:app.Sequelize,
    modelName: 'report',
    tableName: 'report',
    freezeTableName: true
  });

  return Report;
};